#ifndef PANDACLIENT_H
#define PANDACLIENT_H

#include <QtGui/QDialog>
#include "ui_pandaclient.h"

extern bool	gWriteLog;
class PandaClient : public QDialog
{
	Q_OBJECT

public:
	PandaClient(QWidget *parent = 0, Qt::WFlags flags = 0);
	~PandaClient();

	HWND GetHWnd()const{ return m_hWnd; }
	
	void ProcCommand(QStringList command);

protected:
	void createTrayIcon();
	void setVisible(bool visible);
	void closeEvent(QCloseEvent *event);
	void createActions();
	void createMessageWnd();

private slots:
	void setIcon(QIcon icon, QString tip);
	void iconActivated(QSystemTrayIcon::ActivationReason reason);
	void showMessage(QString tip, QSystemTrayIcon::MessageIcon icon );
	void buttonClicked();
	void sliderValueChanged( int value );
	void OnTimer();

	void _AutoStart();
	void _StartTest();

private:
	Ui::PandaClientClass ui;

	QAction *minimizeAction;
	QAction *restoreAction;
	QAction *quitAction;

	QTimer	*timer;
	QSystemTrayIcon *trayIcon;
	QMenu *trayIconMenu;

	CThreadPool	*m_pThreadPool;
	QString		m_strLogFile;

	QTime	startTime;
	HWND	m_hWnd;
};

#endif // PANDACLIENT_H
